const mongoose = require("mongoose");

const userSchema = new mongoose.Schema({
  username: String,
  password: {
    type: String,
    select: false, // 默认不返回密码字段
  },
  avatar: {
    type: String,
    default: "",
  },
  sex: {
    type: String,
    default: "",
  },
  desc: {
    type: String,
    default: "",
  },
  phone: {
    type: String,
    default: "",
  },
  email: {
    type: String,
    default: "",
  },
});

const User = mongoose.model("users", userSchema);

module.exports = {
  User,
};
